package com.numbfish.ch02_ex05_aop_annotation;

import com.numbfish.ch02_ex05_aop_annotation.pojo.Boy;
import com.numbfish.ch02_ex05_aop_annotation.pojo.Human;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;

@SpringBootTest
@Slf4j

public class Ch02Ex05AopAnnotationTestApp {
    @Autowired
    private  ApplicationContext applicationContext;

    @Test
    public void test1(){
        Boy boy = applicationContext.getBean(Boy.class);
        boy.jump();
    }

    @Test
    public void test2(){
        Human human = applicationContext.getBean("human", Human.class);
        human.jump();
    }
}